package com.eric.code.oauth2.common;

import com.eric.code.oauth2.intercepter.SessionInterceptor;
import com.eric.code.oauth2.login.LoginService;
import com.eric.code.oauth2.model.User;
import com.jfinal.aop.Before;

/**
 * Created by eric on 2017/3/24.
 */
@Before(SessionInterceptor.class)
public class IndexController extends BaseController {
    public void index(){
        User user = getLoginUser();
        switch (user.getType()){
            case LoginService.USER_NORMAL:
                redirect("/my");
                break;
            case LoginService.USER_ADMIN:
                redirect("/app");
                break;
        }
    }
}
